
import cn.hutool.core.bean.OptionalBean;
import cn.hutool.core.comparator.CompareUtil;
import cn.hutool.core.convert.ConverterRegistry;
import cn.hutool.core.lang.Assert;
import cn.hutool.log.StaticLog;
import com.deer.wms.base.system.model.Item.ItemInfo;
import com.deer.wms.project.root.util.DateUtils;
import lombok.extern.slf4j.Slf4j;


import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date;
import java.util.Optional;


@Slf4j
public class demo {
    public static void main(String[] args) {
        ItemInfo itemInfo = null;
        String optionl = Optional.ofNullable(itemInfo).map(item -> item.getItemCode()).orElse("111");
        System.out.println(optionl);


        //比较工具
        int a = CompareUtil.compare(null, ""  , true);
        int b = CompareUtil.compare(null, "null", false);
        //日志
        StaticLog.info("This is static {} log.", "INFO");

        //

        int a1 = 3423;
        ConverterRegistry converterRegistry = ConverterRegistry.getInstance();
        String result = converterRegistry.convert(String.class, 3423);


        OptionalBean.ofNullable("1111");
        String a2 = null;
        Assert.isNull(a2);

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println(sdf.format(new Date()));   ;
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//        Calendar c = Calendar.getInstance();
//        try {
//            int i = c.get(Calendar.DAY_OF_MONTH);
////            i = 60;
//            c.setTime(sdf.parse(DateUtils.getNowDateTimeString()));
//            if (i >= 28) {
//                c.add(Calendar.MONTH, 1);
//                c.set(Calendar.DATE, 1);
//            }
//            Date start = c.getTime();
//            System.out.println(sdf.format(start));
//        } catch (ParseException e) {
//            e.printStackTrace();
//        }


    }
}
